A Virtual Extensible LAN (VXLAN) is a network virtualization technology, and is used to resolve an extensibility problem caused by large-scale cloud computing deployment. The Virtual Extensible LAN is applied to a data center network, and enables a virtual machine (VM) to migrate within a range of three layers of networks that are connected to each other, without a need to change an Internet Protocol (IP) address or a Media Access Control (MAC) address of the VM, thereby ensuring service continuity. In the VXLAN, separation between a virtual network and a physical network is implemented by deploying an intelligent entity at an edge of the physical network, that is, a VXLAN tunnel end point (VTEP). A tunnel is established between VTEPs, and when a data frame of the virtual network is transmitted in the physical network over the tunnel, the physical network does not perceive the virtual network.
In an operation and maintenance process of the data center network, for purposes such as traffic monitoring and fault diagnosis, it is necessary to know a packet forwarding path between any two VTEPs in the data center network, a forwarding path of particular traffic (identified by at least one of a particular protocol type, a particular source port number, or a particular destination port number) between two particular VMs in the data center network, and a forwarding path of particular traffic between a VM and a server or a host in a conventional network.
In the prior art, the last bit of the last reserved byte of a VXLAN header of a VXLAN encapsulated packet is set to 1 to denote a probe identifier, so as to identify a probe packet. A controller sends, using a packet-out message, a VXLAN encapsulated probe packet to a source device. When sending the probe packet, the source device sets the last bit of a reserved byte in a VXLAN header to 1. When the probe packet is forwarded in the data center network, a network device that receives the probe packet sends the probe packet to the controller using a packet-in message, and the controller calculates, according to received multiple probe packets, an actual forwarding path of the probe packet sent by the controller.
In the foregoing solution, because the probe identifier of the probe packet is in the VXLAN header, only a forwarding path of the probe packet in the VXLAN network can be determined. If a destination device of the probe packet is a server outside the VXLAN network, the probe packet cannot carry the probe identifier after the VXALN header is removed on a VXLAN gateway. Therefore, in the foregoing solution, only a path from the source device to the gateway can be probed, and a complete path from the source device to the destination device cannot be probed. Even if the gateway can re-encapsulate the probe packet using a VXLAN header, the gateway does not add a probe identifier to the probe packet, and as a result, probing of the packet forwarding path between the source device and the destination device across subnets is interrupted on the gateway, and the complete path between the source device and the destination device cannot be probed.